home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / gnu / djgpp / src / gas-211 / gas / expr.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-05-30  |  2.6 KB  |  75 lines

  1. /* expr.h -> header file for expr.c
  2.    Copyright (C) 1987, 1992 Free Software Foundation, Inc.
  3.  
  4.    This file is part of GAS, the GNU Assembler.
  5.  
  6.    GAS is free software; you can redistribute it and/or modify
  7.    it under the terms of the GNU General Public License as published by
  8.    the Free Software Foundation; either version 2, or (at your option)
  9.    any later version.
  10.  
  11.    GAS is distributed in the hope that it will be useful,
  12.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14.    GNU General Public License for more details.
  15.  
  16.    You should have received a copy of the GNU General Public License
  17.    along with GAS; see the file COPYING.  If not, write to
  18.    the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  19.  
  20. /*
  21.  * Abbreviations (mnemonics).
  22.  *
  23.  *    O    operator
  24.  *    Q    quantity,  operand
  25.  *    X    eXpression
  26.  */
  27.  
  28. /*
  29.  * By popular demand, we define a struct to represent an expression.
  30.  * This will no doubt mutate as expressions become baroque.
  31.  *
  32.  * Currently, we support expressions like "foo-bar+42".
  33.  * In other words we permit a (possibly undefined) minuend, a
  34.  * (possibly undefined) subtrahend and an (absolute) augend.
  35.  * RMS says this is so we can have 1-pass assembly for any compiler
  36.  * emissions, and a 'case' statement might emit 'undefined1 - undefined2'.
  37.  *
  38.  * To simplify table-driven dispatch, we also have a "segment" for the
  39.  * entire expression. That way we don't require complex reasoning about
  40.  * whether particular components are defined; and we can change component
  41.  * semantics without re-working all the dispatch tables in the assembler.
  42.  * In other words the "type" of an expression is its segment.
  43.  */
  44.  
  45. typedef struct
  46. {
  47.   symbolS *X_add_symbol;    /* "foo", above */
  48.   symbolS *X_subtract_symbol;    /* "bar", above */
  49.   long X_add_number;        /* 42, above -- must be signed */
  50.   /* What segment (expr type)? */
  51.   segT X_seg;
  52. }
  53.  
  54. expressionS;
  55.  
  56. /* "result" should be type (expressionS *). */
  57. #define expression(result) expr(0,result)
  58.  
  59. /* If an expression is SEG_BIG, look here for its value. These common
  60.    data may be clobbered whenever expr() is called. */
  61. /* Flonums returned here.  Big enough to hold most precise flonum. */
  62. extern FLONUM_TYPE generic_floating_point_number;
  63. /* Bignums returned here. */
  64. extern LITTLENUM_TYPE generic_bignum[];
  65. /* Number of littlenums in above. */
  66. #define SIZE_OF_LARGE_NUMBER (20)
  67.  
  68. typedef char operator_rankT;
  69.  
  70. char get_symbol_end PARAMS ((void));
  71. segT expr PARAMS ((int rank, expressionS * resultP));
  72. unsigned int get_single_number PARAMS ((void));
  73.  
  74. /* end of expr.h */
  75.